package com.chen.Sign.controller;

import com.chen.Sign.pojo.Swagger;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class SwaggerController {

    @GetMapping(value = "/hello")
    public String hello() {
        return "hello";
    }

    // 只要我们的接口中，返回值中存在实体类，他就会被扫描到Swagger中
    @PostMapping(value = "/user")
    public Swagger swagger() {
        return new Swagger();
    }

    // Operation接口
    @ApiOperation("swagger控制类")
    @GetMapping(value = "/hello2")
    public String hello2(@ApiParam("用户名") String username){
        return "hello" + username;
    }

}
